package com.wkbb.basic.config;

import com.wkbb.common.utils.StringUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author Alger Yang
 * @date 2019/8/26 002615:48
 */
@ConfigurationProperties("wkbb.basic")
@Component
@Data
public class BasicConfig {

    //XMPP服务
    private String xmppServer;

    //优图应用ID
    private Long utuSdkAppid;

    //优图应用秘钥ID
    private String utuSecretId;

    //优图应用秘钥
    private String utuSecretKey;

    private Long utuQq;

    private String utuUrl;

    private String utuTxToken;

    private Boolean utuFlag;

    //微众人脸
    private String webankAppid;
    private String webankSecret;
    private String webankUrl;

    //部署在腾讯云第三方服务接口地址
    private String tcThirdServiceUrl;

    //智慧校园appid
    private String appId;

    //智慧校园秘钥
    private String appSecret;


    //智慧校园开发者标识
    private String devCode;

    //智慧校园开发者标识
    private String devType;

    //人脸相似度阈值
    private String faceSimilar;

    //是否允许调用微众ticket接口的appid白名单，为ALL就全放开
    private String whiteListOfWebankSignTicket;

    //机构 ID， 由腾讯云申请分配,我方在腾讯云的机构ID
    private String webankOrgId;

    //企微(默认账户和企微账户)
    private Long defaultAccountId;
    private Long defaultCpAccountId;

    public boolean enableGetSignTicket(String webankAppid){
        if(!StringUtil.isEmptyIgnoreBlank(whiteListOfWebankSignTicket) && (whiteListOfWebankSignTicket.equals("ALL") || whiteListOfWebankSignTicket.contains(webankAppid))){
            return  true;
        }else{
            return false;
        }
    }
}
